package controller;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

public class ImageHandling {
	public static  JPanel AssignBg(final String path) throws IOException	{
		JPanel p=new JPanel()	{
			private static final long serialVersionUID = 1L;
			File input=new File(path);
			BufferedImage image=ImageIO.read(input);
				public void paintComponent(Graphics g)	{
					super.paintComponents(g);
					g.drawImage(image, 0, 0, this);
				}
		};
		return p;
	}
}
